/**
 *
 */
package cn.hg.jfsa.manage.controller.module.goods.validator;

import com.jfinal.core.Controller;

import cn.hg.base.jfinal.validator.BaseValidator;

/**
 * @author Golly
 */
public class GoodsCategoryValidator extends BaseValidator {

	/*
	 * (non-Javadoc)
	 * @see com.jfinal.validate.Validator#handleError(com.jfinal.core.Controller)
	 */
	@Override
	protected void handleError (Controller c) {}

	/*
	 * (non-Javadoc)
	 * @see com.jfinal.validate.Validator#validate(com.jfinal.core.Controller)
	 */
	@Override
	protected void validate (Controller c) {
		this.setShortCircuit(true);
		this.validateString("goodsCategory.name", 2, 50, "nameMsg", "商品分类名必须填写2到50长度的字符！");
		this.validateRequired("goodsCategory.sortNum", "sortNumMsg", "排序号为必填！");
		this.validateInteger("goodsCategory.sortNum", 0, Short.MAX_VALUE, "sortNumMsg", "排序号范围0到65535！");
	}

}
